package com.nopay.cdxphone.utils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * @ProjectName: myVisualPhone
 * @Package: cn.cn.myvisualphone.utils
 * @ClassName: GsonUtils
 * @Description: java类作用描述
 * @Author: anqi
 * @CreateDate: 2021/5/23 19:07
 * @UpdateUser: 更新者
 * @UpdateDate: 2021/5/23 19:07
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class GsonUtils {
    /**
     * 将object对象转成json格式字符串
     */
    public static String toJson(Object object) {
        GsonBuilder gsonBuilder = new GsonBuilder();
        gsonBuilder.setPrettyPrinting();
        Gson gson = gsonBuilder.create();
        return gson.toJson(object);
    }

}
